﻿using System;
using System.Collections.Generic;
using WSPay.Common;
using WSPay.Common.Data;

namespace WSPay.Domain
{
    /// <summary>
    /// 文史币充值订单，充值币值以人民币为单位
    /// </summary>
    public class WSBRechargeOrder:IEntity
    {
        public WSBRechargeOrder()
        {
            OrderId = "R".RandomNo();
        }

        /// <summary>
        /// 流水号
        /// </summary>
        public int ID { get; set; }

        public string OrderId { get; set; }
        public string PayerName { get; set; }

        /// <summary>
        /// 客户编号
        /// </summary>
        public Guid UserID { get; set; }

        /// <summary>
        /// 充值类型
        /// </summary>
        public RechargeSource RechargeSource { get; set; }

        /// <summary>
        /// 充值状态
        /// </summary>
        public RechargeState RechargeState { get; set; }

        /// <summary>
        /// 充值总额
        /// </summary>
        public decimal TotalPrice { get; set; }

        /// <summary>
        /// 支付总额
        /// </summary>
        public decimal PayAmount { get; set; }

        /// <summary>
        /// 创建时间
        /// </summary>
        public DateTime CreateTime { get; set; }

        /// <summary>
        /// 最后更新时间
        /// </summary>
        public DateTime UpdateTime { get; set; }

        /// <summary>
        /// 备注
        /// </summary>
        public string Remark { get; set; }

        /// <summary>
        /// 支付宝交易号
        /// </summary>
        public string AliPayOrderId { get; set; }

        /// <summary>
        /// 充值平台 
        /// </summary>
        public RechargePlat Plat { set; get; }
        /// <summary>
        /// 充值的文史币数量
        /// </summary>
        public decimal Coin { set; get; }
        /// <summary>
        /// 行级锁
        /// </summary>
        public byte[] RowVersion { set; get; }
       
    }

    public enum RechargeState
    {
        /// <summary>
        /// 未支付
        /// </summary>
        [EnumItemDescription("未支付")]
        Unpaid = 0,

        /// <summary>
        /// 等待处理
        /// </summary>
        [EnumItemDescription("等待处理")]
        Wait = 1,

        /// <summary>
        /// 完成
        /// </summary>
        [EnumItemDescription("完成")]
        Completed = 2,

        /// <summary>
        /// 失败
        /// </summary>
        [EnumItemDescription("失败")]
        Failure = 3
    }
    public enum RechargeSource
    {
        /// <summary>
        /// 网银
        /// </summary>
        EBank=0,

        /// <summary>
        /// 汇款
        /// </summary>
        Remit=1,

        /// <summary>
        /// 后台充值
        /// </summary>
        Admin=2,
        /// <summary>
        /// 支付宝
        /// </summary>
        AliPay=3,
        /// <summary>
        /// 微信
        /// </summary>
        Weixin=4
    }

    public enum RechargePlat {
        /// <summary>
        /// pc充值
        /// </summary>
        Pc=0,
        /// <summary>
        /// 安卓app充值
        /// </summary>
        Android=1,
        /// <summary>
        /// 苹果app充值
        /// </summary>
        Ios = 2,
        /// <summary>
        /// wap端充值
        /// </summary>
        Wap = 3,
        /// <summary>
        /// 其它平台充值
        /// </summary>
        Other = 4
    }
}
